3.7.47 \(\int \sec ^4(c+d x) (a+b \tan (c+d x))^n \, dx\) [647]

Optimal. Leaf size=88 \[ \frac {\left (a^2+b^2\right ) (a+b \tan (c+d x))^{1+n}}{b^3 d (1+n)}-\frac {2 a (a+b \tan (c+d x))^{2+n}}{b^3 d (2+n)}+\frac {(a+b \tan (c+d x))^{3+n}}{b^3 d (3+n)} \]

[Out]

(a^2+b^2)*(a+b*tan(d*x+c))^(1+n)/b^3/d/(1+n)-2*a*(a+b*tan(d*x+c))^(2+n)/b^3/d/(2+n)+(a+b*tan(d*x+c))^(3+n)/b^3
/d/(3+n)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3587, 711} \begin {gather*} \frac {\left (a^2+b^2\right ) (a+b \tan (c+d x))^{n+1}}{b^3 d (n+1)}-\frac {2 a (a+b \tan (c+d x))^{n+2}}{b^3 d (n+2)}+\frac {(a+b \tan (c+d x))^{n+3}}{b^3 d (n+3)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^4*(a + b*Tan[c + d*x])^n,x]

[Out]

((a^2 + b^2)*(a + b*Tan[c + d*x])^(1 + n))/(b^3*d*(1 + n)) - (2*a*(a + b*Tan[c + d*x])^(2 + n))/(b^3*d*(2 + n)
) + (a + b*Tan[c + d*x])^(3 + n)/(b^3*d*(3 + n))

Rule 711

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rule 3587

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \sec ^4(c+d x) (a+b \tan (c+d x))^n \, dx &=\frac {\text {Subst}\left (\int (a+x)^n \left (1+\frac {x^2}{b^2}\right ) \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {\left (a^2+b^2\right ) (a+x)^n}{b^2}-\frac {2 a (a+x)^{1+n}}{b^2}+\frac {(a+x)^{2+n}}{b^2}\right ) \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=\frac {\left (a^2+b^2\right ) (a+b \tan (c+d x))^{1+n}}{b^3 d (1+n)}-\frac {2 a (a+b \tan (c+d x))^{2+n}}{b^3 d (2+n)}+\frac {(a+b \tan (c+d x))^{3+n}}{b^3 d (3+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.67, size = 101, normalized size = 1.15 \begin {gather*} \frac {\sec ^2(c+d x) \left (a^2+4 b^2+4 b^2 n+b^2 n^2+\left (a^2+b^2 (2+n)\right ) \cos (2 (c+d x))-a b (1+n) \sin (2 (c+d x))\right ) (a+b \tan (c+d x))^{1+n}}{b^3 d (1+n) (2+n) (3+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^4*(a + b*Tan[c + d*x])^n,x]

[Out]

(Sec[c + d*x]^2*(a^2 + 4*b^2 + 4*b^2*n + b^2*n^2 + (a^2 + b^2*(2 + n))*Cos[2*(c + d*x)] - a*b*(1 + n)*Sin[2*(c
 + d*x)])*(a + b*Tan[c + d*x])^(1 + n))/(b^3*d*(1 + n)*(2 + n)*(3 + n))

________________________________________________________________________________________

Maple [F]
time = 0.29, size = 0, normalized size = 0.00 \[\int \left (\sec ^{4}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{n}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x)

[Out]

int(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 116, normalized size = 1.32 \begin {gather*} \frac {\frac {{\left (b \tan \left (d x + c\right ) + a\right )}^{n + 1}}{b {\left (n + 1\right )}} + \frac {{\left ({\left (n^{2} + 3 \, n + 2\right )} b^{3} \tan \left (d x + c\right )^{3} + {\left (n^{2} + n\right )} a b^{2} \tan \left (d x + c\right )^{2} - 2 \, a^{2} b n \tan \left (d x + c\right ) + 2 \, a^{3}\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n}}{{\left (n^{3} + 6 \, n^{2} + 11 \, n + 6\right )} b^{3}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

((b*tan(d*x + c) + a)^(n + 1)/(b*(n + 1)) + ((n^2 + 3*n + 2)*b^3*tan(d*x + c)^3 + (n^2 + n)*a*b^2*tan(d*x + c)
^2 - 2*a^2*b*n*tan(d*x + c) + 2*a^3)*(b*tan(d*x + c) + a)^n/((n^3 + 6*n^2 + 11*n + 6)*b^3))/d

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 176, normalized size = 2.00 \begin {gather*} \frac {{\left (2 \, {\left (2 \, a b^{2} n + a^{3} + 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + {\left (a b^{2} n^{2} + a b^{2} n\right )} \cos \left (d x + c\right ) + {\left (b^{3} n^{2} + 3 \, b^{3} n + 2 \, b^{3} + 2 \, {\left (2 \, b^{3} - {\left (a^{2} b - b^{3}\right )} n\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \left (\frac {a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )}{\cos \left (d x + c\right )}\right )^{n}}{{\left (b^{3} d n^{3} + 6 \, b^{3} d n^{2} + 11 \, b^{3} d n + 6 \, b^{3} d\right )} \cos \left (d x + c\right )^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

(2*(2*a*b^2*n + a^3 + 3*a*b^2)*cos(d*x + c)^3 + (a*b^2*n^2 + a*b^2*n)*cos(d*x + c) + (b^3*n^2 + 3*b^3*n + 2*b^
3 + 2*(2*b^3 - (a^2*b - b^3)*n)*cos(d*x + c)^2)*sin(d*x + c))*((a*cos(d*x + c) + b*sin(d*x + c))/cos(d*x + c))
^n/((b^3*d*n^3 + 6*b^3*d*n^2 + 11*b^3*d*n + 6*b^3*d)*cos(d*x + c)^3)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan {\left (c + d x \right )}\right )^{n} \sec ^{4}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4*(a+b*tan(d*x+c))**n,x)

[Out]

Integral((a + b*tan(c + d*x))**n*sec(c + d*x)**4, x)

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c))^n,x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Unable to divide, perhaps due to rounding error%%%{1,[0,1,2,0,0,0]%%%}+%%%{1,[0,1,0,2,0,0]%%%}+%%%{-2,[0,1,
0,1,1,0]%%%

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n}{{\cos \left (c+d\,x\right )}^4} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(c + d*x))^n/cos(c + d*x)^4,x)

[Out]

int((a + b*tan(c + d*x))^n/cos(c + d*x)^4, x)

________________________________________________________________________________________